package com.ruoyi.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.dto.LeaveSummaryDTO;
import com.ruoyi.common.core.domain.dto.leaveStatisticsDTO;
import com.ruoyi.common.core.domain.dto.submitLeaveDTO;
import com.ruoyi.common.core.domain.dto.wsdLeavesDTO;
import com.ruoyi.common.core.domain.entity.WsdLeaves;
import com.ruoyi.common.core.domain.vo.*;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
 * 请假Service接口
 *
 * @author ruoyi
 * @date 2024-04-16
 */
public interface IWsdLeavesService extends IService<WsdLeaves>
{
    /**
     * 查询请假
     *
     * @param id 请假主键
     * @return 请假
     */
    public WsdLeaves selectWsdLeavesById(Long id);

    /**
     * 查询请假列表
     *
     * @param wsdLeaves 请假
     * @return 请假集合
     */
    public List<wsdLeavesVO> selectWsdLeavesList(wsdLeavesDTO wsdLeavesDTO);

    /**
     * 新增请假
     *
     * @param wsdLeaves 请假
     * @return 结果
     */
    public int insertWsdLeaves(WsdLeaves wsdLeaves);

    /**
     * 修改请假
     *
     * @param wsdLeaves 请假
     * @return 结果
     */
    public int updateWsdLeaves(WsdLeaves wsdLeaves);

    /**
     * 批量删除请假
     *
     * @param ids 需要删除的请假主键集合
     * @return 结果
     */
    public int deleteWsdLeavesByIds(Long[] ids);

    /**
     * 删除请假信息
     *
     * @param id 请假主键
     * @return 结果
     */
    public int deleteWsdLeavesById(Long id);

    /**
     * 提交请假请求
     * @param
     * @return
     */
    int submitLeave(submitLeaveDTO submitLeaveDTO);


    /**
     * 请假统计
     * @return
     */
    public List<leaveStatisticsVO> leaveStatistics(leaveStatisticsDTO leaveStatisticsDTO);

    /**
     * 请假信息
     * @param leaveSummaryDTO
     * @return
     */
    List<LeaveSummaryVO> LeaveSummary(LeaveSummaryDTO leaveSummaryDTO);

    /**
     * @param leaveSummaryDTO
     * @return
     */
    LeaveSummaryVO getInfo(LeaveSummaryDTO leaveSummaryDTO);

    /**
     * 查询审核和未审核请假记录列表
     * @param auditing
     * @param schoolId
     * @return
     */
    List<wsdLeavesVO> selectWsdLeaveslistAuditing(Boolean auditing, Long schoolId);

    List<Map<String, Object>> queryLeaveCounts(LocalDate today, LocalDate startOfWeek, LocalDate endOfWeek, LocalDate startOfMonth, LocalDate endOfMonth, Long schoolId);

    /**
     * 获取周的柱状图
     * @return
     */
    ChartDataVO queryWeeklyLeaveCounts(Long schoolId);

    /**
     * 获取月的柱状图
     *
     * @param schoolId
     * @param year
     * @param month
     * @return
     */
    ChartDataVO queryMonthlyLeaveCounts(Long schoolId, Optional<Integer> year, Optional<Integer> month);

    /**
     * 获取年的柱状图
     * @param schoolId
     * @return
     */
    ChartDataVO queryYearlyLeaveCounts(Long schoolId);


    /**
     *
     * 获取今天的请假情况
     * @return
     */
    leaveNumberVO todayLeaveStatus(Long schoolId);

    /**
     * 代办事项显示
     * @param schoolId
     * @return
     */
    AgencyMattersVO agencyMatters(Long schoolId);


    int selectStudentsWsdLeave(String studentId,Date startTime,Date endTime);

    /**
     * 查询停餐人数
     * @param schoolId
     * @return
     */
    Integer countTodayApprovedLeaves(Long schoolId);

    /**
     * 获取学生请假早中晚餐
     *
     * @param leaveSummaryDTO
     * @return
     */
    List<RefundAvailabilityVO> getInfoStudent(LeaveSummaryDTO leaveSummaryDTO);

}
